package com.whut.mobilesafe.activity;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.Preference;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.whut.mobilesafe.R;
import com.whut.mobilesafe.utils.PrefUtils;

import org.w3c.dom.Text;

import java.lang.ref.PhantomReference;

import javax.xml.parsers.SAXParser;

/**
 * 作    者：yubo.xiaoyubo
 * 时    间：2015/12/21  12:44.
 * 版    本：1.0
 * 描    述：手机防盗页面Activity
 */
public class LostAndFoundActivity extends Activity {

    private TextView tvReSetting;
    private TextView tvSafeNumber;
    private ImageView ivLock;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.lost_found_activity);

        tvSafeNumber = (TextView)findViewById(R.id.tv_safe_number);
        ivLock = (ImageView)findViewById(R.id.iv_lock);
        String safePhone = PrefUtils.getString(this, "safe_phone");
        if(!TextUtils.isEmpty(safePhone)){
            tvSafeNumber.setText(safePhone);
        }
        boolean protect = PrefUtils.getBoolean("protect", false, this);
        if(protect){
            ivLock.setImageResource(R.mipmap.lock);
        }else{
            ivLock.setImageResource(R.mipmap.unlock);
        }
        tvReSetting = (TextView) findViewById(R.id.tv_re_setting);
        tvReSetting.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //当点击重新设置按钮的时候，重新进入step1Activity的页面
                Intent intent = new Intent(getApplicationContext(), Step1Activity.class);
                startActivity(intent);
            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

}
